package com.bsoft.gol.hcb.dao.prescriptionCirculation;

import ctd.persistence.annotation.DAOMethod;
import ctd.persistence.annotation.DAOParam;
import ctd.persistence.support.hibernate.HibernateSupportDelegateDAO;
import pcn.consultation.ExpressOrderDetail;

import java.util.List;

public abstract class ExpreeOrderDetailDAO extends HibernateSupportDelegateDAO<ExpressOrderDetail> {
    public ExpreeOrderDetailDAO(){
        this.setKeyField("detailId");
    }


    @DAOMethod(sql = "from ExpressOrderDetail where expressId in (:expressIds)")
    public abstract List<ExpressOrderDetail> findByExpressId(@DAOParam("expressIds")List<String> expressIds);

    @DAOMethod(sql = "from ExpressOrderDetail where expressId=:expressIds ")
    public abstract List<ExpressOrderDetail> findByExId(@DAOParam("expressIds")String expressId);

    @DAOMethod(sql = "from ExpressOrderDetail where expressId =:expressId")
    public abstract ExpressOrderDetail getDetailByExpressId(@DAOParam("expressId")String expressId);
    @DAOMethod(sql = "from ExpressOrderDetail where expressId in(:expressIds)")
    public abstract List<ExpressOrderDetail> findDetailByExpressIds(@DAOParam("expressIds")List<String> expressId);

    @DAOMethod(sql = "from ExpressOrderDetail where detailId =:detailId")
    public abstract ExpressOrderDetail getDetailBydetailId(@DAOParam("detailId")String detailId);

    @DAOMethod(sql = "update ExpressOrderDetail set deliverFlag='1',deliveryTime=now()  where expressId =:expressId")
    public abstract void updateDetailByExpressId(@DAOParam("expressId")String expressId);
}
